<template>
 <div class="auto">
    <swiper :options="swiperOption" >
            <swiper-slide v-for="item in list" :key="item.id">
                <img class="swiper-img" :src="item.imgUrl">
            </swiper-slide>
            <div class="swiper-pagination"  slot="pagination"></div>
    <!--  <div class="swiper-button-prev" slot="button-prev"></div>    左边箭头 
        <div class="swiper-button-next" slot="button-next"></div>         右边箭头  
        <div class="swiper-scrollbar"   slot="scrollbar"></div>         灰色进度条 -->
    </swiper>
  </div>
</template>

<script>
export default {
    name: 'homeswiper',
    props: {
          list:Array,  
        },
    data() {
        return {
            swiperOption:{
                pagination:'.swiper-pagination',  //传入圆形轮播点(默认为圆点)
                loop:true ,  //允许轮播
                autoplay:2000,
                speed:2000,
            },
      
            }
        }
    }
</script>

<style scoped>
    .auto>>>.swiper-pagination-bullet-active{
        background: #ffffff
    }                  /* >>>层级穿透,忽略了scoped限制样式的影响 */
    .auto{
        overflow: hidden;
        height: 0;
        width: 100%;
        padding-bottom: 31.25%;
        background: #eee;
    }
    .swiper-img{
        width: 100%
    }
</style>

